<?php

$con = mysqli_connect('localhost', 'root', '');

mysqli_select_db($con, '2002');

// 设置编码
mysqli_query($con, "set charset 'utf8'");
mysqli_query($con, "set character set 'utf8'");

$id = $_GET['id'];

$sql = "delete from shop where id=$id";

$res = mysqli_query($con, $sql);

if ($res) {
    echo json_encode(array(
        "code" => 1,
        "body" => array(
            "msg" => "删除商品成功"
        )
    ));
} else {
    echo json_encode(array(
        "code" => 0,
        "body" => array(
            "msg" => "网络错误，请重试"
        )
    ));
}


?>